Lines Matching full:code
24 <li><a href="#precode">Code Blocks</a></li>
31 <li><a href="#code">Code</a></li>
86 <p>The only restrictions are that block-level HTML elements -- e.g. <code><div></code>,
87 <code><table></code>, <code><pre></code>, <code><p></code>, etc. -- must be separated from surrounding
90 to add extra (unwanted) <code><p></code> tags around HTML block-level tags.</p>
94 <pre><code>This is a regular paragraph.
103 </code></pre>
106 HTML tags. E.g., you can't use Markdown-style <code>*emphasis*</code> inside an
109 <p>Span-level HTML tags -- e.g. <code><span></code>, <code><cite></code>, or <code><del></code> -- can be
112 you'd prefer to use HTML <code><a></code> or <code><img></code> tags instead of Markdown's
120 <p>In HTML, there are two characters that demand special treatment: <code><</code>
121 and <code>&</code>. Left angle brackets are used to start tags; ampersands are
123 characters, you must escape them as entities, e.g. <code>&lt;</code>, and
124 <code>&amp;</code>.</p>
127 write about 'AT&T', you need to write '<code>AT&amp;T</code>'. You even need to
130 <pre><code>http://images.google.com/images?num=30&q=larry+bird
131 </code></pre>
135 <pre><code>http://images.google.com/images?num=30&amp;q=larry+bird
136 </code></pre>
138 <p>in your anchor tag <code>href</code> attribute. Needless to say, this is easy to
145 into <code>&amp;</code>.</p>
149 <pre><code>&copy;
150 </code></pre>
154 <pre><code>AT&T
155 </code></pre>
159 <pre><code>AT&amp;T
160 </code></pre>
166 <pre><code>4 < 5
167 </code></pre>
171 <pre><code>4 &lt; 5
172 </code></pre>
174 <p>However, inside Markdown code spans and blocks, angle brackets and
176 Markdown to write about HTML code. (As opposed to raw HTML, which is a
177 terrible format for writing about HTML syntax, because every single <code><</code>
178 and <code>&</code> in your example code needs to be escaped.)</p>
195 character in a paragraph into a <code><br /></code> tag.</p>
197 <p>When you <em>do</em> want to insert a <code><br /></code> break tag using Markdown, you
200 <p>Yes, this takes a tad more effort to create a <code><br /></code>, but a simplistic
201 "every line break is a <code><br /></code>" rule wouldn't work for Markdown.
212 <pre><code>This is an H1
217 </code></pre>
219 <p>Any number of underlining <code>=</code>'s or <code>-</code>'s will work.</p>
224 <pre><code># This is an H1
229 </code></pre>
237 <pre><code># This is an H1 #
242 </code></pre>
246 <p>Markdown uses email-style <code>></code> characters for blockquoting. If you're
249 wrap the text and put a <code>></code> before every line:</p>
251 <pre><code>> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
257 </code></pre>
259 <p>Markdown allows you to be lazy and only put the <code>></code> before the first
262 <pre><code>> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
268 </code></pre>
271 adding additional levels of <code>></code>:</p>
273 <pre><code>> This is the first level of quoting.
278 </code></pre>
281 and code blocks:</p>
283 <pre><code>> ## This is a header.
288 > Here's some example code:
291 </code></pre>
304 <pre><code>* Red
307 </code></pre>
311 <pre><code>+ Red
314 </code></pre>
318 <pre><code>- Red
321 </code></pre>
325 <pre><code>1. Bird
328 </code></pre>
334 <pre><code><ol>
339 </code></pre>
343 <pre><code>1. Bird
346 </code></pre>
350 <pre><code>3. Bird
353 </code></pre>
370 <pre><code>* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
375 </code></pre>
379 <pre><code>* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
384 </code></pre>
387 items in <code><p></code> tags in the HTML output. For example, this input:</p>
389 <pre><code>* Bird
391 </code></pre>
395 <pre><code><ul>
399 </code></pre>
403 <pre><code>* Bird
406 </code></pre>
410 <pre><code><ul>
414 </code></pre>
420 <pre><code>1. This is a list item with two paragraphs. Lorem ipsum dolor
429 </code></pre>
435 <pre><code>* This is a list item with two paragraphs.
442 </code></pre>
444 <p>To put a blockquote within a list item, the blockquote's <code>></code>
447 <pre><code>* A list item with a blockquote:
451 </code></pre>
453 <p>To put a code block within a list item, the code block needs
456 <pre><code>* A list item with a code block:
458 <code goes here>
459 </code></pre>
464 <pre><code>1986. What a great season.
465 </code></pre>
470 <pre><code>1986\. What a great season.
471 </code></pre>
473 <h3 id="precode">Code Blocks</h3>
475 <p>Pre-formatted code blocks are used for writing about programming or
476 markup source code. Rather than forming normal paragraphs, the lines
477 of a code block are interpreted literally. Markdown wraps a code block
478 in both <code><pre></code> and <code><code></code> tags.</p>
480 <p>To produce a code block in Markdown, simply indent every line of the
483 <pre><code>This is a normal paragraph:
485 This is a code block.
486 </code></pre>
490 <pre><code><p>This is a normal paragraph:</p>
492 <pre><code>This is a code block.
493 </code></pre>
494 </code></pre>
497 line of the code block. For example, this:</p>
499 <pre><code>Here is an example of AppleScript:
504 </code></pre>
508 <pre><code><p>Here is an example of AppleScript:</p>
510 <pre><code>tell application "Foo"
513 </code></pre>
514 </code></pre>
516 <p>A code block continues until it reaches a line that is not indented
519 <p>Within a code block, ampersands (<code>&</code>) and angle brackets (<code><</code> and <code>></code>)
521 easy to include example HTML source code using Markdown -- just paste
525 <pre><code> <div class="footer">
528 </code></pre>
532 <pre><code><pre><code>&lt;div class="footer"&gt;
535 </code></pre>
536 </code></pre>
538 <p>Regular Markdown syntax is not processed within code blocks. E.g.,
539 asterisks are just literal asterisks within a code block. This means
544 <p>You can produce a horizontal rule tag (<code><hr /></code>) by placing three or
549 <pre><code>* * *
560 </code></pre>
577 <pre><code>This is [an example](http://example.com/ "Title") inline link.
580 </code></pre>
584 <pre><code><p>This is <a href="http://example.com/" title="Title">
589 </code></pre>
594 <pre><code>See my [About](/about/) page for details.
595 </code></pre>
600 <pre><code>This is [an example][id] reference-style link.
601 </code></pre>
605 <pre><code>This is [an example] [id] reference-style link.
606 </code></pre>
611 <pre><code>[id]: http://example.com/ "Optional Title Here"
612 </code></pre>
628 <pre><code>[id]: <http://example.com/> "Optional Title Here"
629 </code></pre>
634 <pre><code>[id]: http://example.com/longish/path/to/resource/here
636 </code></pre>
643 <pre><code>[link text][a]
645 </code></pre>
654 <pre><code>[Google][]
655 </code></pre>
659 <pre><code>[Google]: http://google.com/
660 </code></pre>
665 <pre><code>Visit [Daring Fireball][] for more information.
666 </code></pre>
670 <pre><code>[Daring Fireball]: http://daringfireball.net/
671 </code></pre>
680 <pre><code>I get 10 times more traffic from [Google] [1] than from
686 </code></pre>
690 <pre><code>I get 10 times more traffic from [Google][] than from
696 </code></pre>
700 <pre><code><p>I get 10 times more traffic from <a href="http://google.com/"
704 </code></pre>
709 <pre><code>I get 10 times more traffic from [Google](http://google.com/ "Google")
712 </code></pre>
730 <p>Markdown treats asterisks (<code>*</code>) and underscores (<code>_</code>) as indicators of
731 emphasis. Text wrapped with one <code>*</code> or <code>_</code> will be wrapped with an
732 HTML <code><em></code> tag; double <code>*</code>'s or <code>_</code>'s will be wrapped with an HTML
733 <code><strong></code> tag. E.g., this input:</p>
735 <pre><code>*single asterisks*
742 </code></pre>
746 <pre><code><em>single asterisks</em>
753 </code></pre>
760 <pre><code>un*fucking*believable
761 </code></pre>
763 <p>But if you surround an <code>*</code> or <code>_</code> with spaces, it'll be treated as a
770 <pre><code>\*this text is surrounded by literal asterisks\*
771 </code></pre>
773 <h3 id="code">Code</h3>
775 <p>To indicate a span of code, wrap it with backtick quotes (<code>`</code>).
776 Unlike a pre-formatted code block, a code span indicates code within a
779 <pre><code>Use the `printf()` function.
780 </code></pre>
784 <pre><code><p>Use the <code>printf()</code> function.</p>
785 </code></pre>
787 <p>To include a literal backtick character within a code span, you can use
790 <pre><code>``There is a literal backtick (`) here.``
791 </code></pre>
795 <pre><code><p><code>There is a literal backtick (`) here.</code></p>
796 </code></pre>
798 <p>The backtick delimiters surrounding a code span may include spaces --
800 literal backtick characters at the beginning or end of a code span:</p>
802 <pre><code>A single backtick in a code span: `` ` ``
804 A backtick-delimited string in a code span: `` `foo` ``
805 </code></pre>
809 <pre><code><p>A single backtick in a code span: <code>`</code></p>
811 <p>A backtick-delimited string in a code span: <code>`foo`</code></p>
812 </code></pre>
814 <p>With a code span, ampersands and angle brackets are encoded as HTML
818 <pre><code>Please don't use any `<blink>` tags.
819 </code></pre>
823 <pre><code><p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
824 </code></pre>
828 <pre><code>`&#8212;` is the decimal-encoded equivalent of `&mdash;`.
829 </code></pre>
833 <pre><code><p><code>&amp;#8212;</code> is the decimal-encoded
834 equivalent of <code>&amp;mdash;</code>.</p>
835 </code></pre>
847 <pre><code>![Alt text](/path/to/img.jpg)
850 </code></pre>
855 <li>An exclamation mark: <code>!</code>;</li>
856 <li>followed by a set of square brackets, containing the <code>alt</code>
859 the image, and an optional <code>title</code> attribute enclosed in double
865 <pre><code>![Alt text][id]
866 </code></pre>
871 <pre><code>[id]: url/to/image "Optional title attribute"
872 </code></pre>
876 use regular HTML <code><img></code> tags.</p>
886 <pre><code><http://example.com/>
887 </code></pre>
891 <pre><code><a href="http://example.com/">http://example.com/</a>
892 </code></pre>
899 <pre><code><address@example.com>
900 </code></pre>
904 <pre><code><a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
908 </code></pre>
922 literal asterisks (instead of an HTML <code><em></code> tag), you can backslashes
925 <pre><code>\*literal asterisks\*
926 </code></pre>
930 <pre><code>\ backslash
942 </code></pre>